// part1:C14:14.18:my_StrBlobPtr.h
#ifndef MY_STRBLOBPTR_H__
#define MY_STRBLOBPTR_H__
class StrBlobPtr
{
public:
    StrBlobPtr();
    ~StrBlobPtr(){}
    friend bool operator==(const StrBlobPtr &lhs, const StrBlobPtr &rhs);
    friend bool operator!=(const StrBlobPtr &lhs, const StrBlobPtr &rhs);
    friend bool operator<(const StrBlobPtr &lhs, const StrBlobPtr &rhs);
    friend bool operator<=(const StrBlobPtr &lhs, const StrBlobPtr &rhs);
    friend bool operator>(const StrBlobPtr &lhs, const StrBlobPtr &rhs);
    friend bool operator>=(const StrBlobPtr &lhs, const StrBlobPtr &rhs);
};

bool operator==(const StrBlobPtr &lhs, const StrBlobPtr &rhs)
{
    auto l = lhs.wptr.lock(), r = rhs.wptr.lock();
    if (l == r) 
    {
        return (!r || lsh.curr == rhs.curr);   
    }
    else 
    {
        return false;
    }
}

bool operator!=(const StrBlobPtr &lhs, const StrBlobPtr &rhs)
{
    return !(lhs == rhs);
}

bool operator<(const StrBlobPtr &lhs, const StrBlobPtr &rhs)
{
    auto l = lhs.wptr.lock(), r = rhs.wptr.lock();
    if (lhs == rhs) 
    {
        if (!rhs) 
        {
            return false;
        }
        return (lhs.curr < rhs.curr);
    }
    else
    {
        return false;
    }
}

bool operator<=(const StrBlobPtr &lhs, const StrBlobPtr &rhs)
{
    auto l = lhs.wptr.lock(), r = rhs.wptr.lock();
    if (lhs == rhs) 
    {
        return (!r || lhs.curr <= rhs.curr);
    }
    else
    {
        return false;
    }
}
bool operator>(const StrBlobPtr &lhs, const StrBlobPtr &rhs)
{
    auto l = lhs.wptr.lock(), r = rhs.wptr.lock();
    if (lhs == rhs) 
    {
        if (!rhs) 
        {
            return false;
        }
        return (lhs.curr > rhs.curr);
    }
    else
    {
        return false;
    }
}

bool operator>=(const StrBlobPtr &lhs, const StrBlobPtr &rhs)
{
    auto l = lhs.wptr.lock(), r = rhs.wptr.lock();
    if (lhs == rhs) 
    {
        return (!r || lhs.curr >= rhs.curr);
    }
    else
    {
        return false;
    }
}
#endif
